package com.atguigu.structure.adapter.objectadapter;

import com.atguigu.structure.adapter.classadapter.Voltage220V;

import java.time.temporal.ValueRange;

public class VoltageAdapter implements Voltage5V {
    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int src= voltage220V.output220V();
        System.out.println("适配降压:220V->5V");
        int dst=src/44;

        return dst;
    }
}
